#include "options_tabu.h"

/** Nacte nastaveni tabu search algoritmu z daneho XML elementu.
 * \param settings XML element s nastavenim tabu search algoritmu
 */
void TabuOptions::Read(ticpp::Element * settings) {
	settings->GetAttributeOrDefault("alpha", &alpha, 0.1);
	settings->GetAttributeOrDefault("history", &history, 10);
	settings->GetAttributeOrDefault("loops", &loop_count, 1000);
	initial = settings->FirstChildElement(false);
}

/** Vypise do logu nastaveni tabu search algoritmu.
 */
void TabuOptions::Print() {
	Log() << GetTitle() << " = nastaveni Tabu Search:" << std::endl;
}

/** Vrati kratky popis nastaveni tabu search algoritmu.
 * \return popis nastaveni
 */
std::string TabuOptions::GetTitle() {
	char title[64];
	sprintf(title, "H%dL%dA%.2f", history, loop_count, alpha);
	return title;
}
